'use strict';


//1.导入Koa
const Koa = require('koa');

//2.new一个koa实例
let app = new Koa();

//3.use处理请求
app.use(async (ctx, next) => {
    await next();
    ctx.response.type = 'text/html';
    ctx.response.body = '<p>你好 Koa2</p>'
})

//4.监听运行
let port = 4000;
app.listen(port);

console.log(`服务运行在如下地址：http://localhost:${port}`);